#include <bits/stdc++.h>
using namespace std;

void swapElement(char *e1, char *e2)
{
    char temp;
    temp = *e1;
    *e1 = *e2;
    *e2 = temp;
}
void reverseArray(char arr[], int len)
{
    for (int i = 0; i < len / 2; i++)
    {
        swapElement(&arr[i], &arr[len - i - 1]);
    }
}

int iInput(char arr[])
{
    int len = 0;
    while ((*(arr + len) = getchar()) != '\n')
    {
        *(arr + len) -= '0';
        len++;
    }
    return len;
}
void iPrint(char arr[], int len)
{
    for (int t = 0; t < len; t++)
    {
        putchar(arr[t] + '0');
    }
    printf("\n");
}
void add(char num1[], char num2[], int *len1, int *len2)
{
    if (*len1 >= *len2)
    {
        for (int i = 0; i < *len1; i++)
        {
            if (i < *len2)
            {
                num1[i] += num2[i];
            }
            if (num1[i] >= 10)
            {
                if (i == *len1 - 1)
                {
                    *len1 += 1;
                    num1[i + 1] = 0;
                }
                num1[i] -= 10;
                num1[i + 1] += 1;
            }
        }
    }
    else
    {
        printf("len1 must longer than len2");
    }
}
void mul(char num1[], char num2[], int *len1, int *len2)
{
    if (*len1 >= *len2)
    {
        char solve[100] = {0};
        int solveLen = *len1;
        for (int i = 0; i < *len1; i++)
        {
            char temp[100] = {0};
            int tempLen = *len2 + i;
            for (int j = 0; j < tempLen; j++)
            {
                if (j < i)
                {
                    temp[j] = 0;
                }
                else
                {
                    if (j - i < *len2)
                    {
                        temp[j] += num1[i] * num2[j - i];
                    }
                    if (temp[j] >= 10)
                    {
                        temp[j + 1] = temp[j] / 10;
                        temp[j] = temp[j] % 10;
                        if (j == tempLen - 1)
                        {
                            tempLen++;
                        }
                    }
                    solveLen = tempLen;
                }
            }
            add(solve, temp, &solveLen, &tempLen);
        }
        reverseArray(solve, solveLen);
        iPrint(solve, solveLen);
    }
    else
    {
        printf("len1 must longer than len2");
    }
}
int main()
{
    char str1[100];
    char str2[100];
    int len1 = iInput(str1);
    int len2 = iInput(str2);
    // if (len1 >= len2)
    // {
    //     add(str1, str2, &len1, &len2);
    //     reverseArray(str1, len1);
    //     iPrint(str1, len1);
    // }
    // else
    // {
    //     add(str2, str1, &len2, &len1);
    //     reverseArray(str2, len2);
    //     iPrint(str2, len2);
    // }
    reverseArray(str1, len1);
    reverseArray(str2, len2);
    if (len1 >= len2)
    {
        mul(str1, str2, &len1, &len2);
    }
    else
    {
        mul(str2, str1, &len2, &len1);
    }
    system("pause");
    return 0;
}